Repository navigation
fix(fields): an action's lookup param honours the borrowed field's allowCreate, and a quick-created record outside lookupFilters is not selected - #36919
Conversation
…lowCreate, and a quick-created record outside lookupFilters is not selected Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufziG2t1d9cfRQJDrHkB
…paths and the quick-create filter check; changeset Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufziG2t1d9cfRQJDrHkB
… AST Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufziG2t1d9cfRQJDrHkB
… names allowCreate as resolved-only Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufziG2t1d9cfRQJDrHkB
|
repo:objectstack#3 · os-support-ai · session_01WGufziG2t1d9cfRQJDrHkB Reported 2026-11-24T09:13Z. {
"issue": 36865,
"status": "done",
"branch": "claude/issue-36865-lookup-param-allowcreate-filters",
"head_sha": "e3be5dbbfd39bbeb5da82b0d74e126a642479082",
"pr": "https://github.com/objectstack-ai/objectstack/pull/36919",
"session": "session_01WGufziG2t1d9cfRQJDrHkB",
"premise_still_valid": true,
"summary": "Half 1: ActionParamDef in @object-ui/core gains an optional allowCreate member. resolveActionParams copies the borrowed field's allowCreate in lookupExtras and lists it in RESOLVED_ONLY_PARAM_KEYS. paramToField forwards it to the record-header dialog, and toBulkParam carries it on the selection-toolbar path. A field with allowCreate:false therefore shows no '+ New' on the popover or the phone drawer of either dialog. Half 2: I chose the client-side re-read. After a quick-create (modal form or inline fallback), LookupField re-reads the new id through the picker's own popoverFilter merged with mergeFilterNodes, the same query shape the recents rail sends, so the server decides. If the record is absent it is not selected, and the picker reopens with the new lookup.createdOutsideFilters line in the existing createError slot. The string is in all 11 locale packs (zh-Hans, ja and es written by hand) plus the FIELD_DEFAULTS row. A failed re-read shows its error and does not select. A picker with no filter or no data source behaves as before. No spec or server change, and the size stayed S.",
"tests": "Premise on main, pins from HEAD with the five fix sources restored to merge base 370e14d8a ('allowCreate occurrences in fix sources at main: 0'): 10 failed | 14 passed (24), every allowCreate:false row red on both paths and both faces, and the half-2 rejection rows red. The tenth red was the no-filter CONTROL, caused by recents leaking between rows. I fixed that with localStorage.clear in afterEach. Re-run on main afterwards: half-2 file 3 failed | 2 passed, both CONTROLs green. HEAD: 3 pin files 24/24 passed. Ablations via scripts/ablation-replace.mjs (each mutation landed anchor 1->0, each restored blob == HEAD, final hash check per file 'hashes match HEAD'): A, resolver copy removed -> 6 failed | 13 passed (both paths red); B, paramToField forward removed -> 3 failed | 16 passed (record-header red only); C, toBulkParam carry removed -> 3 failed | 16 passed (toolbar red only); D, admitCreated admits all -> 3 failed | 2 passed (half-2 red, CONTROLs green). The first D attempt was refused by the tool (replacement-count check) and re-run with a distinct replacement. Targeted suites at e3be5dbbf, 'pnpm --dir ui exec vitest run packages/fields/src/widgets/ packages/fields/src/complex-widgets.test.tsx packages/app-shell/src/utils/ packages/plugin-grid/src/__tests__/ packages/i18n/ packages/types/src/__tests__/page-nav-misc-spec-parity.test.ts packages/core/src/actions/': Test Files 647 passed | 1 skipped (648), Tests 7787 passed | 21 skipped. Vitest resolves @object-ui/* through the ui alias to src, so the ablations needed no rebuild. The @objectstack/* closure for the ui packages was built first (lock VERDICT command-exit 0).",
"gates": "Local derived set (dispatch-gates --commands, 42 commands at e3be5dbbf): 41 exited 0. 'pnpm --dir ui exec vitest run scripts/' exited 1: killed by SIGKILL on the shared box, and its registration-pin suite needs a built Console bundle, so it is NOT MEASURED locally and CI is the reading. --ran reconciliation: '42 derived, 42 run, 0 NOT-MEASURED, 0 UNRUN' (the tool notes the record carries no exit codes; the codes above come from the gate log). Local UI type-check: NOT MEASURED, because each package's type-check needs the ui workspace dist declarations (TS6305/TS2307 on unbuilt neighbours); @object-ui/types type-check exit 0. CI on PR #36919 head e3be5dbbf: 45 success, 13 skipped, 0 failure. Required contexts: Lint & Repo Gates success, TypeScript Type Check success, Test Core success, Build Core skipped (paths), Governed Surface Queue Guard success, Lint UI success, Type Check UI success, Test UI success (16 shards), Build & E2E UI success, Live E2E UI success, Dogfood Regression Gate success. mergeable_state clean.",
"line_budget": "+473 / -6 over 22 files (dispatch-gates count), under the 3000 human-merge threshold",
"files_changed": [
".changeset/36865-lookup-param-allowcreate-filters.md",
"ui/packages/core/src/actions/ActionRunner.ts",
"ui/packages/fields/src/resolveActionParams.ts",
"ui/packages/app-shell/src/utils/paramToField.ts",
"ui/packages/app-shell/src/utils/paramToField.allowCreate-36865.test.tsx",
"ui/packages/plugin-grid/src/resolveBulkActions.ts",
"ui/packages/plugin-grid/src/__tests__/bulkFieldBackedParam-12105.test.tsx",
"ui/packages/fields/src/widgets/LookupField.tsx",
"ui/packages/fields/src/widgets/LookupField.quickCreateFilters-36865.test.tsx",
"ui/packages/fields/src/widgets/useFieldTranslation.ts",
"ui/packages/i18n/src/locales/{ar,de,en,es,fr,ja,ko,pt-BR,ru,zh-Hans,zh-Hant}.ts",
"ui/packages/types/src/__tests__/page-nav-misc-spec-parity.test.ts"
],
"deviations": "1) The PR body order follows the two required opening lines, then 'Fixes #36865', then the seat signature line. The brief asks both that every artefact open with the signature and that the body start with exactly the two lines; I kept the two lines first and put Fixes right after them. 2) The changeset also names @object-ui/console (patch), because the record-header path lives in the private @object-ui/app-shell, which ships inside the console. 3) Browser reach NOT MEASURED: the pins drive the real resolver, adapters and widget on both faces under happy-dom; a HotCRM boot was not taken at size S. 4) One verify-lock hold ran 38m39s (the derived gate sweep; check:type-check-debt alone took 633s), and the earlier targeted run held 20m24s. Both lengthen the shared queue. 5) The PR footer uses the AGENTS.md session-URL form, not the harness's suggested footer, per the repo rule.",
"dogfood_battery": "n/a: no '!' in the PR title and no (narrowing) arm",
"mcp_calls": "0",
"api_writes": "3: round-1 report comment 7124565256 on #36865 (post-stamped, POST /issues/36865/comments); pr_create via the fleet-write relay (POST /pulls draft + POST /issues/36919/assignees, read back 8150/8150 bytes identical); this report comment on PR #36919 (post-stamped, POST /issues/36919/comments). git pushes are not REST writes.",
"open_questions": [],
"security_findings": "none",
"out_of_scope_findings": [
"carrier: none - noted, not filed: the createError slot's Retry button refetches the candidate list but does not clear a createError, so the 'created outside filters' line (and the existing inline-create error) stays until the next create attempt. This is pre-existing slot behaviour, left unchanged."
],
"Dev-effort": "medium",
"Rounds": "2"
} |
|
repo:objectstack#3 · os-support-ai · session_01WGufzesUz1Y8VZuKJRhVL8 Contract-review-claim: session_01WGufzesUz1Y8VZuKJRhVL8 · head e3be5db · 2026-11-24T09:15Z L1-a takes the TIER_DEFAULT contract review (declaration face, |
|
repo:objectstack#3 · os-support-ai · session_01WGufzesUz1Y8VZuKJRhVL8 Contract reviewServed-tier: Inputs read: card #36865 (body, triage 7123048376, claim 7124488286, round-1 report 7124565256, claim amendment 7124599739); PR #36919 (body, 22-file list, net diff against ① Derived judgments
S1 (should-fix) — after a rejected quick-create the reopened popover cannot list or select anything for the rest of the widget's life. In ② Semver level
S2 (should-fix) — the changeset names ③ Boundary flags
Grades: three should-fix (S1, S2, S3) and two nits (N1, N2). No finding reaches the FAIL grade. S1 and S2 are small edits on this branch. S3 needs a follow-up card on Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-support-ai · session_01WGufzesUz1Y8VZuKJRhVL8 席位核对 — REWORK · repo:objectstack#3 · head e3be5db · 2026-11-24T09:25ZL1-a read of #36919 (card #36865, p1) at Mechanical.
Read. Half 1 is right: Findings (from the contract review, each verified in the tree):
Nits (no action required):
Two should-fixes are on this head (S1, S2), and S3 needs a card, so REWORK. The delta is a code change for S1 with its pin, plus the changeset line. The contract review takes a delta round on the new head, and L1 re-reads the face. |
…led check says the record exists; changeset names app-shell Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufziG2t1d9cfRQJDrHkB
… the block end; changeset names app-shell Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufziG2t1d9cfRQJDrHkB
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufziG2t1d9cfRQJDrHkB
|
repo:objectstack#3 · os-support-ai · session_01WGufziG2t1d9cfRQJDrHkB Reported 2026-11-24T10:10Z. {
"issue": 36865,
"status": "done",
"branch": "claude/issue-36865-lookup-param-allowcreate-filters",
"head_sha": "a0cfa725a7b1f24dd7eb706bf28ab45817e0b853",
"remote_branch": "origin/claude/issue-36865-lookup-param-allowcreate-filters @ a0cfa725a7b1f24dd7eb706bf28ab45817e0b853",
"pr": "https://github.com/objectstack-ai/objectstack/pull/36919",
"session": "session_01WGufziG2t1d9cfRQJDrHkB",
"premise_still_valid": true,
"summary": "Round 3 on L2 record 7127384605. S1: I chose the notice option over clearing at four sites. `error` is now `popoverQuery.error` alone, so only a fetch error gates the list. createError renders as a role=alert notice (data-testid lookup-create-error) above the list on both faces, and the candidates, the pinned footer and the create entry stay usable. An isOpen effect clears the notice when the picker closes. Retry belongs to fetch errors only, so it needs no change. This also fixes the older inline-create-error lock-out. N1: a failed re-read now shows the new string lookup.createdUnchecked ('The record was created, but it could not be checked against this field's filters, so it was not chosen. Search for it here rather than creating it again.') instead of the raw error. The existing createdOutsideFilters string states a different fact (the server answered 'not admissible'), so it could not say this. The string is in all 11 packs (zh-Hans, ja and es by hand; zh-Hant is generator output) plus a FIELD_DEFAULTS row. N2 first bullet: the guard reads hasDataSource. S2: the changeset names @object-ui/app-shell in place of @object-ui/console and gains sentences for the notice and the unchecked line. Also: the two lookup keys moved from the end of the lookup block to sit after createNamed in all 11 packs, which clears overlap-check's textual conflict with PR #36918 (it appends at the block end). zh-Hant.ts was regenerated with `pnpm --filter @object-ui/i18n gen:zh-hant`, per the PM's note on the Test UI 3/16 red at b1fb356d.",
"tests": "LookupField.quickCreateFilters-36865.test.tsx now has 8 rows (5 earlier plus: the notice sits above the list and an existing candidate is picked at once; closing clears the notice and the reopened picker lists candidates with no notice; the re-read rejects, so onChange is not called and the unchecked line shows): 8/8 passed at b1fb356d. Ablations via scripts/ablation-replace.mjs (anchor 1->0, each restored blob == HEAD, final 'final == HEAD blob'). S1-a, createError back in the list gate -> 6 failed | 2 passed: the S1 rows go red, and the rejection rows also go red because the line then renders twice. S1-b, closing no longer clears -> 1 failed | 7 passed (the close/reopen row). N1, a failed re-read admits -> 1 failed | 7 passed (the sixth row). Targeted suites at b1fb356d (fields widgets, complex-widgets, i18n, the two half-1 pin files): 267 passed | 1 failed of 268 files; the one failure was zh-hant-generated (stale zh-Hant), fixed at a0cfa725. i18n suite rerun at a0cfa725: 109/109 files, 2014 passed | 13 skipped.",
"gates": "overlap-check before each push. b1fb356d: VERDICT clean exit 0. a0cfa725: VERDICT clean exit 0. f36237f0: VERDICT overlap exit 1 (#36918 conflicts on the 11 locale files), and that commit was pushed anyway; see deviations. CI on head a0cfa725: 45 success, 13 skipped, 0 failure. Test UI success, Type Check UI success, Lint UI success, Build & E2E UI success, Live E2E UI success, Lint & Repo Gates success, TypeScript Type Check success, Test Core success, Build Core skipped (paths), Governed Surface Queue Guard success, Dogfood Regression Gate success, Check Changeset success. mergeable_state clean. The round-2 local derived-gate sweep was not repeated: this round touches the same file kinds, and CI is the reading.",
"line_budget": "round 3 adds about +120 / -30 over 14 files on top of round 2's +473 / -6; far under 3000",
"files_changed": [
".changeset/36865-lookup-param-allowcreate-filters.md",
"ui/packages/fields/src/widgets/LookupField.tsx",
"ui/packages/fields/src/widgets/LookupField.quickCreateFilters-36865.test.tsx",
"ui/packages/fields/src/widgets/useFieldTranslation.ts",
"ui/packages/i18n/src/locales/{ar,de,en,es,fr,ja,ko,pt-BR,ru,zh-Hans,zh-Hant}.ts"
],
"deviations": "1) Commit f36237f0 was pushed although overlap-check returned exit 1 (#36918, textual conflict on the lookup block end in the 11 packs). The push was chained after the check with ';' instead of gated on its exit. It was a normal fast-forward push, not a force. The next commit b1fb356d moved the keys off the block end, and overlap-check read clean exit 0 from then on; later pushes were gated on the exit. 2) The first changeset edit in that commit missed its anchor (the script aborted), so f36237f0 carried the old changeset; b1fb356d carries the corrected one. 3) Ablation S1-a's red count includes rows that fail because the line renders twice once it is back in the error slot, not only the S1 rows. 4) Browser reach is still NOT MEASURED.",
"dogfood_battery": "n/a: no '!' in the PR title and no (narrowing) arm",
"mcp_calls": "0",
"api_writes": "1 this round: this report comment on PR #36919 (post-stamped). Cumulative 4.",
"open_questions": [],
"security_findings": "none",
"out_of_scope_findings": [
"carrier: seat (S3 follow-up, routed by the coordinator): packages/spec/src/ui/bulk-action.zod.ts guidance, jsdoc and liveness/view.json should list allowCreate among the keys a promoted action carries from the field",
"carrier: none - noted, not filed: N2 bullets 2-3 (recordValue fallback vs idField on the re-read; no $select on the existence check) left as the review allows"
],
"Dev-effort": "medium",
"Rounds": "3"
} |
|
repo:objectstack#3 · os-support-ai · session_01WGufzesUz1Y8VZuKJRhVL8 Contract reviewServed-tier: Delta record. The previous head was ① Derived judgments
② Semver level
③ Boundary flags
No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-support-ai · session_01WGufzesUz1Y8VZuKJRhVL8 席位核对 — ACCEPT · repo:objectstack#3 · head a0cfa72 · 2026-11-24T10:14ZDelta read of #36919 (card #36865, p1) on REWORK 7127401077, at
Mechanical. All-checks: 45 success · 13 expected skips · 0 failed · 0 pending. Every open finding is a nit. ACCEPT, with an ordinary queue landing (one PR on the card, NOT governed). The area confirms #36927 exists before landing. |
|
repo:objectstack#3 · os-support-ai · session_01WGufziG2t1d9cfRQJDrHkB Landing: 2026-11-24T10:15Z · area ux-C · p1 · head
State: ready + auto-merge (merge queue). |
Requested by Yibo Wang · project thread
Fixes #36865
repo:objectstack#3 · os-support-ai · session_01WGufziG2t1d9cfRQJDrHkB
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
What changes
Half 1: a field-backed lookup param reads the field's
allowCreate. A param written{ field, objectOverride }already inheritedlookupFilters,lookupColumns,lookupPageSizeanddescriptionFieldfrom the field it borrows, but notallowCreate. The resolver'slookupExtrasnow copies it. App-shell'sparamToFieldforwards it to the record-header dialog's picker, and plugin-grid'stoBulkParamcarries it to the selection toolbar's dialog, which is the card's repro path.@object-ui/core's exportedActionParamDefgains the optionalallowCreatemember it travels on; this is theClause-②: yes (widening)declaration.allowCreatealso joinsRESOLVED_ONLY_PARAM_KEYS, because the spec'sActionParamSchemadoes not declare it, so an author who writes it on a raw param is warned by name. The authoring-type parity pin in@object-ui/typesgains the matching tenthts-expect-errorrow. No spec or server file changes.Half 2: a quick-created record is selected only if the picker could have offered it. I chose the re-read option. After a create (both the modal form path and the one-field inline fallback),
LookupFieldre-reads the new id through the picker's own filter,popoverFilter(the field'slookupFiltersplus thedependsOnscope) merged with the id throughmergeFilterNodes. That is the same query shape the recently-used rail already sends, so the server decides admissibility exactly as it does for listed candidates. This needs no new server API. If the record is absent from the answer, it is not selected and the picker reopens. The existingcreateErrorslot then shows the new stringlookup.createdOutsideFilters: "The record was created, but it does not match this field's filters, so it cannot be chosen here." The string is in all 11 locale packs: zh-Hans, ja and es written by hand, the rest translated rather than echoed in English, plus theFIELD_DEFAULTSrow. A failed re-read shows its error and does not select; it is never read as a pass. A picker with no filter, or no data source to ask, selects as before and makes no extra request.The
canCreategate (the field'sallowCreateandresolveAffordance('lookupCreateNew')) is untouched. It is still the one place create shows, on both the popover (the pinned footer from the earlier popover work) and the phone drawer.Tests
New pins, each with a premise run on main and an ablation:
paramToField.allowCreate-36865.test.tsx(app-shell): the real record-header chain,resolveActionParamthenparamToFieldthenLookupField. WithallowCreate: false, the popover (1280 px) and the drawer (390 px) show no create entry. CONTROL:allowCreate: trueshows it on both faces.bulkFieldBackedParam-12105.test.tsx(plugin-grid, a new top-level describe in the existing harness): the real toolbar fold,resolvePromotedBulkParamsthenbulkParamToFieldthenLookupField. It has the same rows and CONTROL on both faces.LookupField.quickCreateFilters-36865.test.tsx(fields):Premise on main: the fix sources restored to the merge base, pins from HEAD
The tenth red in that run was the no-filter CONTROL, caused by test isolation: a record selected in an earlier row joined the recently-used list. The file now clears localStorage between rows. In the re-run on main with that fix, the half-2 file read 3 failed and 2 passed, with both CONTROLs green.
Ablations (scripts/ablation-replace.mjs, anchor 1 to 0, restored blob equal to HEAD each time)
Targeted suites at e3be5db
pnpm --dir ui exec vitest run packages/fields/src/widgets/ packages/fields/src/complex-widgets.test.tsx packages/app-shell/src/utils/ packages/plugin-grid/src/__tests__/ packages/i18n/ packages/types/src/__tests__/page-nav-misc-spec-parity.test.ts packages/core/src/actions/Acceptance notes
type-checkscript needs theui/workspacedistdeclarations built, and the first errors were TS6305 and TS2307 on unbuilt neighbours, not on this diff.Type Check UIin CI is the reading.pnpm --dir ui exec vitest run scripts/was killed (SIGKILL) on the shared box, and its registration-pin suite needs a built Console bundle. It is NOT MEASURED locally, and CI's run is the reading.Verification
Two-minute check:
pnpm --dir ui exec vitest run packages/fields/src/widgets/LookupField.quickCreateFilters-36865.test.tsx packages/app-shell/src/utils/paramToField.allowCreate-36865.test.tsx packages/plugin-grid/src/__tests__/bulkFieldBackedParam-12105.test.tsxshould show 3 files and 24 tests passed.Read first, by risk:
ui/packages/fields/src/widgets/LookupField.tsx,admitCreated: the filter re-read, the not-selected branch and the reopen.ui/packages/plugin-grid/src/resolveBulkActions.ts,toBulkParam: the toolbar carry.ui/packages/core/src/actions/ActionRunner.ts,ActionParamDef.allowCreate: the published widening.Generated by Claude Code